
const { getBlogComment,insertBlogComment } = require('../service/blogComment.service')
const { success,error } = require('../utils/response')
class BlogCommentControllrt {
  async blogComment(ctx,next) {
    const params = ctx.request.body
    try{
      const res = await getBlogComment(params)
      if(res){
        success(ctx,res)
      } else {
        error(ctx)
      }
    } catch(err)  {
      console.log(err)
      error(ctx,null)
    }
  }
  async addBlogComment(ctx,next){
    const params = ctx.request.body
    try{
      const res = await insertBlogComment(params)
      if(res){
        success(ctx,res)
      } else {
        error(ctx)
      }
    } catch(err)  {
      console.log(err)
      error(ctx,null)
    }
  }
}

module.exports = new BlogCommentControllrt()